package com.sdap2.entity;

import com.sdap2.common.entity.LogicEntity;
import jakarta.persistence.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

@Data
@Entity
@Table(name = "soil_data")
@EqualsAndHashCode(callSuper = true)
@AttributeOverride(name = "deleted", column = @Column(name = "is_deleted"))
public class SoilData extends LogicEntity {
    
    @Column(nullable = false)
    private String name;
    
    @Column(precision = 10, scale = 2, nullable = false)
    private BigDecimal value;
    
    @Column(length = 20)
    private String unit;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "device_id", nullable = false)
    private Device device;
} 